#ifndef GAMEPHASECONTROL_H
#define GAMEPHASECONTROL_H
#include "gs.h"
#include <QStateMachine>
#include "gameboardorganizer.h"
#include "gameboarditem.h"
using namespace gs;

namespace gs
{

class PhaseConsoleItem : public GameBoardItem
{
public:
    PhaseConsoleItem(GameBoardOrganizer* b);
    QRectF boundingRect() const;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);

    static const int WIDTH  = 400;
    static const int HEIGHT = 50;
    void setContent(QString);
protected:
    QString _content;
};


class GamePhaseControl : public GameBoardOrganizer
{
    Q_OBJECT
    Q_ENUMS(GAME_PHASE)
    Q_PROPERTY(GAME_PHASE phase READ getPhase WRITE setPhase)
public:
    enum GAME_PHASE
    {
        TURN_START = 0,
        GHOST_ACT,
        GHOST_ARR,
        TAO_ACT,
        EXO_ACT,
        TURN_FIN
    };
    GamePhaseControl(GameTable*);
    void setPhase(GAME_PHASE);
    GAME_PHASE getPhase(){return _phase;}
protected:
    void createGameMachine();
    QStateMachine* machine;
    GAME_PHASE _phase;

    PhaseConsoleItem* console;
signals:
    void TURN_START_PAUSE();
    void NEXT_PHASE();
};


}

#endif // GAMEPHASECONTROL_H
